import request from "@/utils/request";

// 获取组织列表
export function getDepartmentList() {
  return request({
    url: "/company/department",
  });
}

// 获取负责人列表
export function getMessagerList() {
  return request({
    url: "/sys/user/simple",
  });
}

// 新增部门
export function addDepartment(data) {
  return request({
    url: "/company/department",
    method: "post",
    data,
  });
}

// 获取部门
export function getDepartmentDetail(id) {
  return request({
    url: `/company/department/${id}`,
  });
}

// 编辑部门
export function updataDepartmentDetail(data) {
    return request({
      url: `/company/department/${data.id}`,
      method: "PUT",
      data,
    });
  }

// 删除部门
export function delDepartmentDetail(id) {
    return request({
      url: `/company/department/${id}`,
      method: "DELETE",
    });
  }